﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using shop.Utils;

namespace shop
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!this.IsPostBack)
            {
                SqlConnection conn = DB.createSqlConnection();
                conn.Open();
                //SqlCommand cmd = new SqlCommand("select votetype from votemaster where masterid= " + masterID, conn);
                //this.show.Text = cmd.ExecuteScalar().ToString();


                SqlCommand cmd = new SqlCommand("select * from voteitems where masterid = 1", conn);
                SqlDataReader odr = cmd.ExecuteReader();
                this.RadioButtonList1.DataSource = odr;
                this.RadioButtonList1.DataTextField = "voteitem";
                this.RadioButtonList1.DataValueField = "itemid";
                this.RadioButtonList1.DataBind();
                odr.Close();
                conn.Close();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string s = this.RadioButtonList1.SelectedValue.ToString() ;
            //string ss = this.rblItemList.SelectedItem.Text;
            string sss = this.RadioButtonList1.SelectedValue.ToString();
            this.Response.Write(s + "," + sss);

        }
    }
}
